/*
 * @Description:
 * @Author: 胡涛
 * @Date: 2024-01-13 21:08:26
 * @LastEditors: 胡涛
 * @LastEditTime: 2024-01-21 19:44:19
 */
/**
 * 消息类型
 */
enum HubMessageType {
  Message = "Message",
  Notification = "Notification",
  Notifications = "Notifications",
  Silent = "Silent",
  Action = "Action",
}

/**
 * Hub事件处理类型
 */
enum HubEventType {
  ReceiveMessage = "ReceiveMessage",
  ReceiveNotification = "ReceiveNotification",
  ReceiveNotifications = "ReceiveNotifications",
  ReceiveSilent = "ReceiveSilent",
  ReceiveAction = "ReceiveAction",
}

/**
 * 通知消息类型
 */
enum NotificationType {
  /**
   * 专家登记
   */
  ExpertRegistration = "ExpertRegistration",
  /**
   * 专家审核
   */
  ExpertAudit = "ExpertAudit",
  /**
   * 专家抽取
   */
  ExpertExtract = "ExpertExtract",
  /**
   * 专家公示
   */
  ExpertPublicity = "ExpertPublicity",
}


interface HubMessage<T> {
  type: HubMessageType;
  data: T;
}

interface NotificationDto<T> {
  type: NotificationType;
  targetId: string;
  title: string;
  description: string;
  time: string;
  userIds: Array<string>;
  data: T;
}

export { HubMessageType, NotificationType, HubEventType };
export type { NotificationDto, HubMessage };
